package net.whzjkj.gateway.tcpserver.rabbit.handler;

import com.rabbitmq.client.Channel;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.core.Message;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import org.springframework.stereotype.Component;

import java.io.UnsupportedEncodingException;

/**
 * @Author: shikang
 * @Description: 监听消息数据队列
 * @Date: Created in 2018/3/26 17:01
 */
@Component
@Slf4j
public class MessageDataRabbitHandler {

    @Autowired
    private ThreadPoolTaskExecutor threadPoolExecutor;


    public void onMessage(Message message, Channel channel) throws UnsupportedEncodingException {

        threadPoolExecutor.execute(()-> System.out.println("ssss"));
    }

}
